import request from '@/utils/request'

// 文件上传minio
export function fileUpload(file) {
  //组装参数
  let form = new FormData();
  form.append("file",file.raw)
  return request({
    url: '/common/minio/upload',
    timeout: 1000 * 60,
    method: 'post',
    data: form,
    headers: {"Content-Type": "multipart/form-data; charset=utf-8"},
    contentType: false,
    processData: false,
    withCredentials: false
  })
}

//获取resources的json文件
export function readJson(fileName){
  return request({
    url: '/common/read-json/' + fileName,
    method: 'get',
  })
}
